package com.maliu.manager
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.display.DisplayObjectContainer;
	/**
	 * @author maliu
	 */
	public class LayerManager
	{
		private static var m_instance:LayerManager;
		
		private var m_rootLayer:DisplayObjectContainer;
		private var m_mapLayer:Sprite;
		private var m_uiLayer:Sprite;
		private var m_appLayer:Sprite;
		private var m_tipsLayer:Sprite;
		
		public function LayerManager(_param:Param)
		{}
		public static function GetInstance():LayerManager
		{
			if(!m_instance)
			{
				m_instance = new LayerManager(new Param());
			}
			return m_instance;
		}
		//*********************** API **************************************
		public function setup(_root:DisplayObjectContainer):void
		{
			m_rootLayer = _root;
			m_mapLayer = new Sprite();
			m_rootLayer.addChild(m_mapLayer);
			m_uiLayer = new Sprite();
			m_rootLayer.addChild(m_uiLayer);
			m_appLayer = new Sprite();
			m_rootLayer.addChild(m_appLayer);
			m_tipsLayer = new Sprite();
			m_rootLayer.addChild(m_tipsLayer);
		}
		public function addToMapLayer(_obj:DisplayObject):void
		{
			m_mapLayer.addChild(_obj);
		}
		public function addToUILayer(_obj:DisplayObject):void
		{
			m_uiLayer.addChild(_obj);
		}
		public function addToAppLayer(_obj:DisplayObject):void
		{
			m_appLayer.addChild(_obj);
		}
		public function addToTipsLayer(_obj:DisplayObject):void
		{
			m_tipsLayer.addChild(_obj);
		}
		public function getMapLayer():Sprite
		{
			return m_mapLayer;
		}
		public function getUILayer():Sprite
		{
			return m_uiLayer;
		}
		public function getAppLayer():Sprite
		{
			return m_appLayer;
		}
		public function getTipsLayer():Sprite
		{
			return m_tipsLayer;
		}
	}
}
class Param{}
